package com.doubao.doubao_admin.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
//import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Date;

@Builder
@TableName("ums_user")
@Data
@AllArgsConstructor
//@NoArgsConstructor
@Accessors(chain = true)//链式构造器
//@ApiModel("统一响应对象")
public class UmsUser {
    private static final long serialVersionUID = -5051120337175047163L;

    @TableId(value = "id",type = IdType.ASSIGN_ID)
    private String id = "0";
    @TableField("username")
    private String username;
    @TableField("alias")
    private String alias;
    @JsonIgnore()
    @TableField("password")
    private String password;
    @TableField("avatar")
    private String avatar = "https://image.so.com/i?q=%E5%A4%B4%E5%83%8F%E7%B4%A0%E6%9D%90%E7%BD%91&listsrc=sobox&listsign=ac1a862b429610b5a4f9fb8a47b91c28&src=360pic_new";
    @TableField("email")
    private String email;
    @TableField("mobile")
    private String mobile;
    @Builder.Default
    @TableField("score")
    private Integer score = 0;
    @Builder.Default
    @TableField("bio")
    private String bio = "自由职业者";
    @JsonIgnore()
    @TableField("token")
    private String token;
    @Builder.Default
    @TableField("active")
    private Boolean active = true;
    /**
     * 1.使用 0.已停用
     */
    @TableField("status")
    private Boolean status = true;
    /**
     * 用户角色
     */
    @TableField("role_id")
    private Integer roleId;
    @TableField(value = "create_time",fill = FieldFill.INSERT)
    private Date createTime = new Date();
    @TableField(value = "modify_time",fill = FieldFill.INSERT_UPDATE)
    private Date modifyTime = new Date();

    public UmsUser(String username, String password) {
        this.username = username;
        this.password = password;
    }

    public UmsUser(){

    }
}
